package com.minsheng.epidemic_rep.controller;

import com.minsheng.epidemic_rep.service.IStudentService;
import com.minsheng.epidemic_rep.util.GenerateCsv;
import com.minsheng.epidemic_rep.util.ZipUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

/**
 * @Classname StudentController
 * @Description TODO
 * @Date 2020/9/27 17:01
 * @Created by You
 */
@RestController
public class StudentController {

    @Autowired
    private IStudentService studentService;

    //生成CSV文件
    @RequestMapping("/csv")
    public String craetCsc() {

        studentService.createCsv();

        return "craetCsc!";

    }

//    //清空目录
//    @RequestMapping("/delcsv")
//    public String delcsv() {
//        List<String> pathList = ZipUtil.getFile("g:/csv/",0);
//        try {
//            GenerateCsv.deleteFiles(pathList);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return "delcsv";
//    }

}
